package week3;

import java.util.ArrayList;
import java.util.Iterator;


public class PolyLine {
	//member variables
	private ArrayList<Point> polypoints;
	
	//constructor
	public PolyLine(){polypoints = new ArrayList<Point>();}
	
	//add point method harnessing the array list method
	public boolean add(Point newPoint) {return polypoints.add(newPoint);}
	
	//iterate through points in the array and print them harnessing iterator from arraylists
	public void printAll(){
		System.out.print("The contents of your polyline: "); 
		Iterator<Point> itr = polypoints.iterator(); 
		while(itr.hasNext()) {
			System.out.print(itr.next() + " ");
		}
	} 
	
}
	


